<?php
/**
 * Created by PhpStorm.
 * User: ytl003
 * Date: 2018/10/20
 * Time: 上午12:23
 */

namespace app\api\controller\back;


use app\api\model\BannerModel;
use app\api\service\Back;
use app\api\validate\WhereValidate;

/**
 * Class Banner
 * @package app\api\controller\back
 * @route('back/banner')
 */
class Banner
{
    /**
     * @route('a/:location')
     */
    public function get($location,$size=5){
        (new WhereValidate())->goCheck();
        $banner =  BannerModel::where('location',$location)->order('order')->limit($size)->select();
        return Back::success($banner);
    }
}